<script>
new Validate().failed('resource','url', '<%=error_message_on(:resource, :url)%>');
</script>